{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "9c696879",
   "metadata": {},
   "source": [
    "# 一"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "cc3babb8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=10, tm_mday=6, tm_hour=17, tm_min=22, tm_sec=52, tm_wday=3, tm_yday=279, tm_isdst=0)"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import time\n",
    "time.localtime()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "f67bb80f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3\n",
      "17\n",
      "22\n",
      "no\n"
     ]
    }
   ],
   "source": [
    "week_day = time.localtime().tm_wday\n",
    "print(week_day)\n",
    "\n",
    "time_hour = time.localtime().tm_hour\n",
    "print(time_hour)\n",
    "\n",
    "time_min = time.localtime().tm_min\n",
    "print(time_min)\n",
    "\n",
    "if week_day == 2:\n",
    "    print(\"今天有Python课，好开心呀\")\n",
    "    if time_hour == 19:\n",
    "        print(\"Python课ing\")\n",
    "    elif time_hour == 18 and time_min > 44:\n",
    "        print(\"Python课ing\")\n",
    "    elif time_hour == 20 and time_min < 51:\n",
    "         print(\"Python课ing\")\n",
    "    elif time_hour < 18:\n",
    "        print(\"期待今天的课\")\n",
    "    else:\n",
    "        print(\"今天的Python课很不错\")\n",
    "else:\n",
    "    print(\"no\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "95cc9828",
   "metadata": {},
   "source": [
    "# 二"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "ee5fa58c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "99 bottles 在啤酒墙上~~\n",
      "99 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "98 bottles 在啤酒瓶上\n",
      "\n",
      "98 bottles 在啤酒墙上~~\n",
      "98 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "97 bottles 在啤酒瓶上\n",
      "\n",
      "97 bottles 在啤酒墙上~~\n",
      "97 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "96 bottles 在啤酒瓶上\n",
      "\n",
      "96 bottles 在啤酒墙上~~\n",
      "96 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "95 bottles 在啤酒瓶上\n",
      "\n",
      "95 bottles 在啤酒墙上~~\n",
      "95 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "94 bottles 在啤酒瓶上\n",
      "\n",
      "94 bottles 在啤酒墙上~~\n",
      "94 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "93 bottles 在啤酒瓶上\n",
      "\n",
      "93 bottles 在啤酒墙上~~\n",
      "93 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "92 bottles 在啤酒瓶上\n",
      "\n",
      "92 bottles 在啤酒墙上~~\n",
      "92 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "91 bottles 在啤酒瓶上\n",
      "\n",
      "91 bottles 在啤酒墙上~~\n",
      "91 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "90 bottles 在啤酒瓶上\n",
      "\n",
      "90 bottles 在啤酒墙上~~\n",
      "90 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "89 bottles 在啤酒瓶上\n",
      "\n",
      "89 bottles 在啤酒墙上~~\n",
      "89 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "88 bottles 在啤酒瓶上\n",
      "\n",
      "88 bottles 在啤酒墙上~~\n",
      "88 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "87 bottles 在啤酒瓶上\n",
      "\n",
      "87 bottles 在啤酒墙上~~\n",
      "87 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "86 bottles 在啤酒瓶上\n",
      "\n",
      "86 bottles 在啤酒墙上~~\n",
      "86 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "85 bottles 在啤酒瓶上\n",
      "\n",
      "85 bottles 在啤酒墙上~~\n",
      "85 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "84 bottles 在啤酒瓶上\n",
      "\n",
      "84 bottles 在啤酒墙上~~\n",
      "84 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "83 bottles 在啤酒瓶上\n",
      "\n",
      "83 bottles 在啤酒墙上~~\n",
      "83 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "82 bottles 在啤酒瓶上\n",
      "\n",
      "82 bottles 在啤酒墙上~~\n",
      "82 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "81 bottles 在啤酒瓶上\n",
      "\n",
      "81 bottles 在啤酒墙上~~\n",
      "81 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "80 bottles 在啤酒瓶上\n",
      "\n",
      "80 bottles 在啤酒墙上~~\n",
      "80 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "79 bottles 在啤酒瓶上\n",
      "\n",
      "79 bottles 在啤酒墙上~~\n",
      "79 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "78 bottles 在啤酒瓶上\n",
      "\n",
      "78 bottles 在啤酒墙上~~\n",
      "78 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "77 bottles 在啤酒瓶上\n",
      "\n",
      "77 bottles 在啤酒墙上~~\n",
      "77 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "76 bottles 在啤酒瓶上\n",
      "\n",
      "76 bottles 在啤酒墙上~~\n",
      "76 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "75 bottles 在啤酒瓶上\n",
      "\n",
      "75 bottles 在啤酒墙上~~\n",
      "75 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "74 bottles 在啤酒瓶上\n",
      "\n",
      "74 bottles 在啤酒墙上~~\n",
      "74 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "73 bottles 在啤酒瓶上\n",
      "\n",
      "73 bottles 在啤酒墙上~~\n",
      "73 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "72 bottles 在啤酒瓶上\n",
      "\n",
      "72 bottles 在啤酒墙上~~\n",
      "72 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "71 bottles 在啤酒瓶上\n",
      "\n",
      "71 bottles 在啤酒墙上~~\n",
      "71 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "70 bottles 在啤酒瓶上\n",
      "\n",
      "70 bottles 在啤酒墙上~~\n",
      "70 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "69 bottles 在啤酒瓶上\n",
      "\n",
      "69 bottles 在啤酒墙上~~\n",
      "69 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "68 bottles 在啤酒瓶上\n",
      "\n",
      "68 bottles 在啤酒墙上~~\n",
      "68 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "67 bottles 在啤酒瓶上\n",
      "\n",
      "67 bottles 在啤酒墙上~~\n",
      "67 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "66 bottles 在啤酒瓶上\n",
      "\n",
      "66 bottles 在啤酒墙上~~\n",
      "66 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "65 bottles 在啤酒瓶上\n",
      "\n",
      "65 bottles 在啤酒墙上~~\n",
      "65 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "64 bottles 在啤酒瓶上\n",
      "\n",
      "64 bottles 在啤酒墙上~~\n",
      "64 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "63 bottles 在啤酒瓶上\n",
      "\n",
      "63 bottles 在啤酒墙上~~\n",
      "63 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "62 bottles 在啤酒瓶上\n",
      "\n",
      "62 bottles 在啤酒墙上~~\n",
      "62 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "61 bottles 在啤酒瓶上\n",
      "\n",
      "61 bottles 在啤酒墙上~~\n",
      "61 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "60 bottles 在啤酒瓶上\n",
      "\n",
      "60 bottles 在啤酒墙上~~\n",
      "60 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "59 bottles 在啤酒瓶上\n",
      "\n",
      "59 bottles 在啤酒墙上~~\n",
      "59 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "58 bottles 在啤酒瓶上\n",
      "\n",
      "58 bottles 在啤酒墙上~~\n",
      "58 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "57 bottles 在啤酒瓶上\n",
      "\n",
      "57 bottles 在啤酒墙上~~\n",
      "57 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "56 bottles 在啤酒瓶上\n",
      "\n",
      "56 bottles 在啤酒墙上~~\n",
      "56 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "55 bottles 在啤酒瓶上\n",
      "\n",
      "55 bottles 在啤酒墙上~~\n",
      "55 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "54 bottles 在啤酒瓶上\n",
      "\n",
      "54 bottles 在啤酒墙上~~\n",
      "54 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "53 bottles 在啤酒瓶上\n",
      "\n",
      "53 bottles 在啤酒墙上~~\n",
      "53 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "52 bottles 在啤酒瓶上\n",
      "\n",
      "52 bottles 在啤酒墙上~~\n",
      "52 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "51 bottles 在啤酒瓶上\n",
      "\n",
      "51 bottles 在啤酒墙上~~\n",
      "51 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "50 bottles 在啤酒瓶上\n",
      "\n",
      "50 bottles 在啤酒墙上~~\n",
      "50 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "49 bottles 在啤酒瓶上\n",
      "\n",
      "49 bottles 在啤酒墙上~~\n",
      "49 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "48 bottles 在啤酒瓶上\n",
      "\n",
      "48 bottles 在啤酒墙上~~\n",
      "48 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "47 bottles 在啤酒瓶上\n",
      "\n",
      "47 bottles 在啤酒墙上~~\n",
      "47 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "46 bottles 在啤酒瓶上\n",
      "\n",
      "46 bottles 在啤酒墙上~~\n",
      "46 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "45 bottles 在啤酒瓶上\n",
      "\n",
      "45 bottles 在啤酒墙上~~\n",
      "45 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "44 bottles 在啤酒瓶上\n",
      "\n",
      "44 bottles 在啤酒墙上~~\n",
      "44 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "43 bottles 在啤酒瓶上\n",
      "\n",
      "43 bottles 在啤酒墙上~~\n",
      "43 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "42 bottles 在啤酒瓶上\n",
      "\n",
      "42 bottles 在啤酒墙上~~\n",
      "42 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "41 bottles 在啤酒瓶上\n",
      "\n",
      "41 bottles 在啤酒墙上~~\n",
      "41 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "40 bottles 在啤酒瓶上\n",
      "\n",
      "40 bottles 在啤酒墙上~~\n",
      "40 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "39 bottles 在啤酒瓶上\n",
      "\n",
      "39 bottles 在啤酒墙上~~\n",
      "39 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "38 bottles 在啤酒瓶上\n",
      "\n",
      "38 bottles 在啤酒墙上~~\n",
      "38 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "37 bottles 在啤酒瓶上\n",
      "\n",
      "37 bottles 在啤酒墙上~~\n",
      "37 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "36 bottles 在啤酒瓶上\n",
      "\n",
      "36 bottles 在啤酒墙上~~\n",
      "36 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "35 bottles 在啤酒瓶上\n",
      "\n",
      "35 bottles 在啤酒墙上~~\n",
      "35 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "34 bottles 在啤酒瓶上\n",
      "\n",
      "34 bottles 在啤酒墙上~~\n",
      "34 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "33 bottles 在啤酒瓶上\n",
      "\n",
      "33 bottles 在啤酒墙上~~\n",
      "33 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "32 bottles 在啤酒瓶上\n",
      "\n",
      "32 bottles 在啤酒墙上~~\n",
      "32 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "31 bottles 在啤酒瓶上\n",
      "\n",
      "31 bottles 在啤酒墙上~~\n",
      "31 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "30 bottles 在啤酒瓶上\n",
      "\n",
      "30 bottles 在啤酒墙上~~\n",
      "30 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "29 bottles 在啤酒瓶上\n",
      "\n",
      "29 bottles 在啤酒墙上~~\n",
      "29 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "28 bottles 在啤酒瓶上\n",
      "\n",
      "28 bottles 在啤酒墙上~~\n",
      "28 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "27 bottles 在啤酒瓶上\n",
      "\n",
      "27 bottles 在啤酒墙上~~\n",
      "27 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "26 bottles 在啤酒瓶上\n",
      "\n",
      "26 bottles 在啤酒墙上~~\n",
      "26 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "25 bottles 在啤酒瓶上\n",
      "\n",
      "25 bottles 在啤酒墙上~~\n",
      "25 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "24 bottles 在啤酒瓶上\n",
      "\n",
      "24 bottles 在啤酒墙上~~\n",
      "24 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "23 bottles 在啤酒瓶上\n",
      "\n",
      "23 bottles 在啤酒墙上~~\n",
      "23 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "22 bottles 在啤酒瓶上\n",
      "\n",
      "22 bottles 在啤酒墙上~~\n",
      "22 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "21 bottles 在啤酒瓶上\n",
      "\n",
      "21 bottles 在啤酒墙上~~\n",
      "21 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "20 bottles 在啤酒瓶上\n",
      "\n",
      "20 bottles 在啤酒墙上~~\n",
      "20 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "19 bottles 在啤酒瓶上\n",
      "\n",
      "19 bottles 在啤酒墙上~~\n",
      "19 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "18 bottles 在啤酒瓶上\n",
      "\n",
      "18 bottles 在啤酒墙上~~\n",
      "18 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "17 bottles 在啤酒瓶上\n",
      "\n",
      "17 bottles 在啤酒墙上~~\n",
      "17 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "16 bottles 在啤酒瓶上\n",
      "\n",
      "16 bottles 在啤酒墙上~~\n",
      "16 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "15 bottles 在啤酒瓶上\n",
      "\n",
      "15 bottles 在啤酒墙上~~\n",
      "15 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "14 bottles 在啤酒瓶上\n",
      "\n",
      "14 bottles 在啤酒墙上~~\n",
      "14 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "13 bottles 在啤酒瓶上\n",
      "\n",
      "13 bottles 在啤酒墙上~~\n",
      "13 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "12 bottles 在啤酒瓶上\n",
      "\n",
      "12 bottles 在啤酒墙上~~\n",
      "12 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "11 bottles 在啤酒瓶上\n",
      "\n",
      "11 bottles 在啤酒墙上~~\n",
      "11 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "10 bottles 在啤酒瓶上\n",
      "\n",
      "10 bottles 在啤酒墙上~~\n",
      "10 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "9 bottles 在啤酒瓶上\n",
      "\n",
      "9 bottles 在啤酒墙上~~\n",
      "9 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "8 bottles 在啤酒瓶上\n",
      "\n",
      "8 bottles 在啤酒墙上~~\n",
      "8 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "7 bottles 在啤酒瓶上\n",
      "\n",
      "7 bottles 在啤酒墙上~~\n",
      "7 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "6 bottles 在啤酒瓶上\n",
      "\n",
      "6 bottles 在啤酒墙上~~\n",
      "6 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "5 bottles 在啤酒瓶上\n",
      "\n",
      "5 bottles 在啤酒墙上~~\n",
      "5 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "4 bottles 在啤酒瓶上\n",
      "\n",
      "4 bottles 在啤酒墙上~~\n",
      "4 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "3 bottles 在啤酒瓶上\n",
      "\n",
      "3 bottles 在啤酒墙上~~\n",
      "3 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "2 bottles 在啤酒瓶上\n",
      "\n",
      "2 bottles 在啤酒墙上~~\n",
      "2 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "1 bottles 在啤酒瓶上\n",
      "\n",
      "1 bottles 在啤酒墙上~~\n",
      "1 bottles 啤酒~~\n",
      "拿一瓶走~~\n",
      "只剩一瓶了，不能给你了！\n"
     ]
    }
   ],
   "source": [
    "word = \"bottles\"\n",
    "\n",
    "for beer_num in range(99,0,-1):\n",
    "    print(beer_num,word,\"在啤酒墙上~~\")\n",
    "    print(beer_num,word,\"啤酒~~\")\n",
    "    print(\"拿一瓶走~~\")\n",
    "    if beer_num ==1:\n",
    "        print(\"只剩一瓶了，不能给你了！\")\n",
    "    else:\n",
    "        new_num = beer_num - 1\n",
    "        if new_num == 1:\n",
    "            word = \"bottles\"\n",
    "        print(new_num,word,\"在啤酒瓶上\")\n",
    "        print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b768d7b4",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
